#! /usr/bin/env node
const pup = require("puppeteer-core")
const { executablePath } = require("./common")
async function run() {
  const browser = await pup.launch({
    executablePath: executablePath,
    headless: false,
    // 全屏
    defaultViewport: null
  })
  const page = await browser.newPage()
  const startTime = performance.now()
  await page.goto(' http://127.0.0.1:5173/#/login')
  const inpt=await page.$('#inptSignUser')
  await inpt.type('GDluCk')
  const inpt2 = await page.$('#inptSignPass')
  await inpt2.type('123456')
  const btn = await page.$('#btnSign')
  await btn.click()
  await page.waitForNavigation()
  await page.goto('http://127.0.0.1:5173/#/user/personalcenter')
  await page.waitForSelector('.mingyan')
  console.log("链路测试时间:", performance.now() - startTime)
  await browser.close()
}
run()
